package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the send database table.
 * 
 */
@Entity
@Table(name="send")
@NamedQuery(name="Send.findAll", query="SELECT s FROM Send s")
public class Send implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String sendid;

	private String sendstate;

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="cid")
	private Customer customer;

	//bi-directional many-to-one association to Order
	@ManyToOne
	@JoinColumn(name="deliveryid")
	private Order order;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="staffid")
	private Staff staff;

	//bi-directional many-to-one association to Senddetail
	@OneToMany(mappedBy="send")
	private List<Senddetail> senddetails;

	public Send() {
	}

	public String getSendid() {
		return this.sendid;
	}

	public void setSendid(String sendid) {
		this.sendid = sendid;
	}

	public String getSendstate() {
		return this.sendstate;
	}

	public void setSendstate(String sendstate) {
		this.sendstate = sendstate;
	}

	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public List<Senddetail> getSenddetails() {
		return this.senddetails;
	}

	public void setSenddetails(List<Senddetail> senddetails) {
		this.senddetails = senddetails;
	}

	public Senddetail addSenddetail(Senddetail senddetail) {
		getSenddetails().add(senddetail);
		senddetail.setSend(this);

		return senddetail;
	}

	public Senddetail removeSenddetail(Senddetail senddetail) {
		getSenddetails().remove(senddetail);
		senddetail.setSend(null);

		return senddetail;
	}

}